/*
 * Copyright (c) 2007-2021 西安交通信息投资营运有限公司 版权所有
 */

package com.xci.xajtfb.wxc.api;

import com.github.lvyanyang.annotation.Authorize;
import com.github.lvyanyang.core.BaseController;
import com.github.lvyanyang.core.BoolResult;
import com.github.lvyanyang.core.Const;
import com.github.lvyanyang.core.PageList;
import com.github.lvyanyang.core.XCI;
import com.xci.xajtfb.wxc.entity.SchVehicle;
import com.xci.xajtfb.wxc.filter.SchVehicleFilter;
import com.xci.xajtfb.wxc.service.SchVehicleService;
import com.github.lvyanyang.model.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 教练车基本资料接口
 * @author 马星俊 maxingjun@xci96716.com
 * @since 2021-03-01 17:39:46
 */
@Api(tags = "教练车基本资料接口")
@Authorize
@RestController
@RequestMapping(value = "/api/wxc/schVehicle", produces = Const.PROJSON)
public class SchVehicleApiController extends BaseController {
    /** 教练车基本资料服务 */
    @Resource private SchVehicleService schVehicleService;



    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "根据主键查询单个教练车基本资料")
    //@Authorize(code = "wxc.schVehicle.select")
    @PostMapping("/selectById")
    public BoolResult<SchVehicle> selectById(@RequestBody IdBody body) {
        return BoolResult.success(schVehicleService.selectById(body.getId()));
    }

    @ApiOperationSupport(order = 9)
    @ApiOperation(value = "查询教练车基本资料分页列表")
    //@Authorize(code = "wxc.schVehicle.select")
    @PostMapping("/selectPageList")
    public BoolResult<PageList<SchVehicle>> selectPageList(@RequestBody SchVehicleFilter filter) {
        return BoolResult.success(schVehicleService.selectPageList(filter));
    }
}